<ng-template [ngTemplateOutlet]="templateTop" [ngTemplateOutletContext]="this"></ng-template>
<p *ngIf="success" type="success">Successfully updated.</p>
<p *ngIf="error" type="danger"><span [innerHTML]="error"></span></p>

<div class="mat-content">
	<form (ngSubmit)="onSubmit($event)" class="form-wrap">
		<div class="fieldset-container fieldset-display-{{ fieldSetDisplay }}">
			<ng-container *ngFor="let fieldSet of fieldSets; let i = index">
				<div [ngClass]="fieldSet.class" class="fieldset">
					<div *ngFor="let field of fieldSet.config; let ii = index" [ngClass]="field.class == 'inline' ? 'form-inline' : 'form-line'" id="{{fieldSet.name}}-{{ii}}">
						<div dynamicField [config]="field" [group]="formGroup" [fieldShow]="'show'">
						</div>
					</div>
				</div>
			</ng-container>
		</div>
		<mat-card-actions>
			<button class="btn btn-block btn-warning" type="submit" mat-button color="primary">Save</button>
			<button class="btn  btn-block btn-lg btn-primary" type="button" (click)="goBack()" mat-button color="accent">Cancel</button>
		</mat-card-actions>
	</form>
</div>

